﻿<%@ Page Language="C#" AutoEventWireup="true" Inherits="ihongma.Web.UI.Page.shopping" ValidateRequest="false" %>
<%@ Import namespace="System.Collections.Generic" %>
<%@ Import namespace="System.Text" %>
<%@ Import namespace="System.Data" %>
<%@ Import namespace="ihongma.Common" %>

<script runat="server">
override protected void OnInit(EventArgs e)
{

	/* 
		This page was created by ihongma Template Engine at 2014/4/23 19:48:28.
		本页面代码由ihongma模板引擎生成于 2014/4/23 19:48:28. 
	*/

	base.OnInit(e);
	StringBuilder templateBuilder = new StringBuilder(220000);
	templateBuilder.Append("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n<!--[if IE 6 ]>\r\n  <html class=\"ie6\">\r\n  <![endif]-->\r\n  <!--[if IE 7 ]>\r\n    <html class=\"ie7\">\r\n    <![endif]-->\r\n    <html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n      \r\n      <head>\r\n        <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\r\n        <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\r\n       <title>");
	templateBuilder.Append(Utils.ObjectToStr(config.webtitle));
	templateBuilder.Append("</title>\r\n<meta content=\"");
	templateBuilder.Append(Utils.ObjectToStr(config.webkeyword));
	templateBuilder.Append("\" name=\"keywords\" />\r\n<meta content=\"");
	templateBuilder.Append(Utils.ObjectToStr(config.webdescription));
	templateBuilder.Append("\" name=\"description\" />\r\n        <!--css-->\r\n        ");

	templateBuilder.Append("<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge,chrome=1\" />\r\n<link rel=\"shortcut icon\" href=\"/favicon.ico\">\r\n<link rel=\"stylesheet\" href=\"");
	templateBuilder.Append("/templates/JuiceUp");
	templateBuilder.Append("/css/style.css\" type=\"text/css\"\r\nmedia=\"screen\" />\r\n<link rel=\"stylesheet\" media=\"screen and (max-width:991px)\" href=\"");
	templateBuilder.Append("/templates/JuiceUp");
	templateBuilder.Append("/css/max991.css\"\r\n/>\r\n<link rel=\"stylesheet\" media=\"screen and (max-width:479px)\" href=\"");
	templateBuilder.Append("/templates/JuiceUp");
	templateBuilder.Append("/css/max479.css\"\r\n/>\r\n\r\n<link rel=\"stylesheet\" href=\"");
	templateBuilder.Append("/templates/JuiceUp");
	templateBuilder.Append("/css/nivo-slider.css\" type=\"text/css\" media=\"screen\" />\r\n<script src=\"");
	templateBuilder.Append("/templates/JuiceUp");
	templateBuilder.Append("/js/jquery-1.10.2.min.js\"></");
	templateBuilder.Append("script>\r\n\r\n<!--[if lt IE 8]>\r\n    <script type=\"text/javascript\" src=\"");
	templateBuilder.Append("/templates/JuiceUp");
	templateBuilder.Append("/js/DD_belatedPNG_0.0.8a-min.js\">\r\n    </");
	templateBuilder.Append("script>\r\n    <script>\r\n        DD_belatedPNG.fix(\"h1, a, h2, h3, img,.fixpng,.videos li\");\r\n    </");
	templateBuilder.Append("script>\r\n<![endif]-->\r\n<!--[if lt IE 9]>\r\n    <script src=\"");
	templateBuilder.Append("/templates/JuiceUp");
	templateBuilder.Append("/js/html5.js\">\r\n    </");
	templateBuilder.Append("script>\r\n    <script src=\"");
	templateBuilder.Append("/templates/JuiceUp");
	templateBuilder.Append("/js/css3-mediaqueries.js\">\r\n    </");
	templateBuilder.Append("script>\r\n<![endif]-->");


	templateBuilder.Append("\r\n          <!--/css-->\r\n        <link href=\"");
	templateBuilder.Append("/templates/JuiceUp");
	templateBuilder.Append("/css/from/from.css\" rel=\"stylesheet\" type=\"text/css\"\r\n/>\r\n<link rel=\"stylesheet\" type=\"text/css\" href=\"");
	templateBuilder.Append("/templates/JuiceUp");
	templateBuilder.Append("/css/from/jquery.ui.core.css\">\r\n<link rel=\"stylesheet\" type=\"text/css\" href=\"");
	templateBuilder.Append("/templates/JuiceUp");
	templateBuilder.Append("/css/from/jquery.ui.theme.css\">\r\n<link rel=\"stylesheet\" type=\"text/css\" href=\"");
	templateBuilder.Append("/templates/JuiceUp");
	templateBuilder.Append("/css/from/jquery.ui.datepicker.css\">\r\n<script>\r\n\r\n    function CartAmountTotal(obj) {\r\n        if (isNaN($(obj).val())) {\r\n\r\n            $(obj).val(\"0\");\r\n        }\r\n        var order_amount = 0;\r\n        $(\".tetinput_small\").each(function () {\r\n            order_amount = order_amount + ($(this).val() * $(this).attr(\"title\"));\r\n        });\r\n        \r\n        $(\"#goods_amount\").text(order_amount.toFixed(2));\r\n        $(\"#goods_amount\").text(order_amount.toFixed(2));\r\n        //  $(\"goods_amount\").text(\"\");\r\n        //$(\"#price1\").text(order_amount.toFixed(2));\r\n    }\r\n</");
	templateBuilder.Append("script>\r\n      </head>\r\n      \r\n      <body>\r\n        <div class=\"wrapper\">\r\n          <!--Header-->\r\n          ");

	templateBuilder.Append("<div id=\"header\" class=\"contentHead\">\r\n    <div class=\"center_wrapper\">\r\n      <div class=\"juiceUplogo\">\r\n        <div id=\"lg_indicator\">\r\n      <span class=\"menu_open_button\"><img class=\"button\" src=\"");
	templateBuilder.Append("/templates/JuiceUp");
	templateBuilder.Append("/images/menu_open_button.jpg\" width=\"76\" height=\"40\" /></span><a href=\"/\"><img src=\"");
	templateBuilder.Append("/templates/JuiceUp");
	templateBuilder.Append("/images/xhm_logo.jpg\" width=\"95\" height=\"59\"></a>\r\n        </div>\r\n        <div id=\"lg\">\r\n          <a href=\"/\"><img src=\"");
	templateBuilder.Append("/templates/JuiceUp");
	templateBuilder.Append("/images/juiceUp_logo.gif\"></a>\r\n        </div>\r\n      </div>\r\n    </div>\r\n      \r\n    <div class=\"topLinks\">\r\n      <div class=\"center_wrapper\">\r\n        <div class=\"topNews\">New. 现北京地区支持在线订购，其他城市即将开通，敬请关注。</div>\r\n        <div class=\"language\"><!--<a href=\"#\">English</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href=\"#\" class=\"selected\">中文</a>--></div>\r\n        <div class=\"login\" id=\"menu\">\r\n        <span class=\"tel\"> 客服热线：400-082-5955 &nbsp;&nbsp;&nbsp;工作日9:00am-6:00pm</span>\r\n      \r\n        <!--  <a href=\"#\">注 册</a>\r\n          <a href=\"#\" id=\"menu\">登 录</a>-->\r\n         \r\n\r\n        </div>\r\n        <script type=\"text/javascript\">\r\n            $.ajax({\r\n                type: \"POST\",\r\n                url: \"");
	templateBuilder.Append(Utils.ObjectToStr(config.webpath));
	templateBuilder.Append("tools/submit_ajax.ashx?action=user_check_login\",\r\n                dataType: \"json\",\r\n                timeout: 20000,\r\n                success: function (data, textStatus) {\r\n                    if (data.status == 1) {\r\n                        $(\"#menu\").append('<a href=\"");
	templateBuilder.Append(linkurl("usercenter","exit"));

	templateBuilder.Append("\">退出</a>');\r\n                        $(\"#menu\").append('<a href=\"");
	templateBuilder.Append(linkurl("usercenter","index"));

	templateBuilder.Append("\">我的JuiceUp</a>');\r\n                    } else {\r\n                        $(\"#menu\").append('<a href=\"");
	templateBuilder.Append(linkurl("register"));

	templateBuilder.Append("\">注册</a>');\r\n                        $(\"#menu\").append('<a href=\"");
	templateBuilder.Append(linkurl("login"));

	templateBuilder.Append("\">登录</a>');\r\n                    }\r\n                }\r\n            });\r\n    </");
	templateBuilder.Append("script>\r\n      </div>\r\n    </div>\r\n      \r\n    <div class=\"nav_wrapper\">\r\n      <div class=\"center_wrapper\">\r\n        <ul id=\"nav\">\r\n          <li><a href=\"#\">清体排毒</a>\r\n          <div class=\"bottombg ml40\">\r\n          <ul >\r\n         \r\n            <li><a href=\"");
	templateBuilder.Append(linkurl("contentshow",113));

	templateBuilder.Append("\"> 什么是毒素</a></li>\r\n           <li><a href=\"");
	templateBuilder.Append(linkurl("contentshow",112));

	templateBuilder.Append("\">我需要排毒么</a></li>\r\n             \r\n             \r\n          </ul>\r\n          </div>\r\n          </li>\r\n\r\n          <li>\r\n            <a href=\"#\">JuiceUp</a>\r\n            <div class=\"bottombg ml40\">\r\n            <ul >\r\n             \r\n              <li><a href=\"");
	templateBuilder.Append(linkurl("contentshow",110));

	templateBuilder.Append("\">最专业的JuiceUp</a></li>\r\n\r\n              <li><a href=\"");
	templateBuilder.Append(linkurl("contentshow",111));

	templateBuilder.Append("\">果汁餐单</a></li>\r\n                <li><a href=\"");
	templateBuilder.Append(linkurl("contentshow",122));

	templateBuilder.Append("\">冷压技术</a></li>\r\n              <li><a href=\"");
	templateBuilder.Append(linkurl("contentshow",126));

	templateBuilder.Append("\">温馨提示</a></li>\r\n               <span class=\"bottombg\"></span>\r\n             \r\n            </ul>\r\n            </div>\r\n          </li>\r\n          <li>\r\n            <a href=\"#\">选择您的果汁</a>\r\n            <div class=\"bottombg ml22\">\r\n            <ul >\r\n           \r\n              <li><a href=\"");
	templateBuilder.Append(linkurl("contentshow",114));

	templateBuilder.Append("\">level1美味纤体系列</a></li>\r\n              <li><a href=\"");
	templateBuilder.Append(linkurl("contentshow",115));

	templateBuilder.Append("\">level2深层清体系列</a></li>\r\n             \r\n              \r\n             <!-- <li><a href=\"");
	templateBuilder.Append(linkurl("contentshow",117));

	templateBuilder.Append("\">个性化搭配</a></li>-->\r\n              <li><a href=\"");
	templateBuilder.Append(linkurl("contentshow",123));

	templateBuilder.Append("\">在线测试</a></li>\r\n              <!--<li><a href=\"");
	templateBuilder.Append(linkurl("contentshow",118));

	templateBuilder.Append("\">排毒疗程</a></li>-->\r\n              <span class=\"bottombg\"></span>\r\n            </ul>\r\n            </div>\r\n          </li>\r\n          <li>\r\n            <a href=\"#\">价格及配送</a>\r\n            <div class=\"bottombg ml30\">\r\n            <ul >\r\n          \r\n              <li><a href=\"");
	templateBuilder.Append(linkurl("contentshow",119));

	templateBuilder.Append("\">价格&优惠</a></li>\r\n              <li><a href=\"");
	templateBuilder.Append(linkurl("contentshow",121));

	templateBuilder.Append("\">物流配送</a></li>\r\n              <li><a href=\"");
	templateBuilder.Append(linkurl("contentshow",120));

	templateBuilder.Append("\">订购须知</a></li>\r\n              <span class=\"bottombg\"></span>\r\n            </ul>\r\n            </div>\r\n          </li>\r\n          <li><a href=\"");
	templateBuilder.Append(linkurl("feedback"));

	templateBuilder.Append("\">联系我们</a></li>\r\n       \r\n        </ul>\r\n        <!--\r\n        <div class=\"cart\"><a href=\"");
	templateBuilder.Append(linkurl("goods"));

	templateBuilder.Append("\"><i>立即订购</i><span class=\"iconCart\"></span></a></div>\r\n        -->\r\n        <div class=\"cart\" id=\"cartTop\">\r\n          <a href=\"");
	templateBuilder.Append(linkurl("goods"));

	templateBuilder.Append("\"><span number=\"0\" class=\"cartimg1\"></span></a>\r\n        </div>\r\n        <div class=\"cart_pad\"><a href=\"");
	templateBuilder.Append(linkurl("goods"));

	templateBuilder.Append("\">立即订购</a></div>\r\n      </div>\r\n    </div>\r\n  </div>");


	templateBuilder.Append("\r\n            <!--/Header-->\r\n     \r\n            <div id=\"page_modules\">\r\n                    <form name=\"order_form\" id=\"order_form\" url=\"");
	templateBuilder.Append(Utils.ObjectToStr(config.webpath));
	templateBuilder.Append("tools/submit_ajax.ashx?action=neworder_save\">\r\n                   \r\n              <div class=\"center_wrapper center_lineGreen clearfix\">\r\n                <div class=\"left_con_m\">\r\n                  <div class=\"tile_left_m\">\r\n                     <div class=\"tile_zh\">订购您的排毒计划！</div>\r\n          <div class=\"tile_en\"><em class=\"black\">Order</em><em class=\"darkGreen\"> YOUR</em><em class=\"lightGreen\">JUICEUP</em></div>\r\n                  </div>\r\n                  <div class=\"order_warp\">\r\n                    <div class=\"order_step\">\r\n                      <ul>\r\n                        <li>\r\n                          第一步：计划开始日期\r\n                        </li>\r\n                        <li class=\"selected\">\r\n                          第二步：确认\r\n                        </li>\r\n                        <li>\r\n                          第三步：付款\r\n                        </li>\r\n                      </ul>\r\n                    </div>\r\n               <!--     <div class=\"orderNum\">\r\n               注：送达日期为您选择的排毒开始日期的前一天\r\n                    </div>-->\r\n                    <div class=\"orderInfoWarp\">\r\n                                   ");  if (new_get_cart_list().Count == 0)
	                {
	                    HttpContext.Current.Response.Redirect(linkurl("goods"));
	                } 

	int addcount = 0;

	int addfive = 0;

	int modelt__loop__id = 0;;

	IList<ihongma.Model.c_tiems> ls1 = new_get_cart_list();

	DataTable category_list1 = get_article_list("goods", 0, 10, "category_id!=44", "id desc");

	foreach(ihongma.Model.c_tiems modelt in ls1)
	{
modelt__loop__id++;

	templateBuilder.Append("\r\n                     \r\n                          <div class=\"orderInfo\" id=\"info");
	templateBuilder.Append(Utils.ObjectToStr(modelt__loop__id));
	templateBuilder.Append("\">\r\n                            <span class=\"num\">\r\n                              ");
	templateBuilder.Append(Utils.ObjectToStr(modelt__loop__id));
	templateBuilder.Append(".\r\n                            </span>\r\n                            <ul>\r\n                             ");
	var goodsm = modelt.items[0];;

	if (modelt.type==3)
	{

	templateBuilder.Append("\r\n                            \r\n                              <li>\r\n                           \r\n                                <span class=\"tile\">\r\n                                  所选计划：\r\n                                </span>\r\n                                \r\n                               <span>");
	templateBuilder.Append(Utils.ObjectToStr(goodsm.title));
	templateBuilder.Append("</span>\r\n                              <input id=\"Hidden3\" name=\"type");
	templateBuilder.Append(Utils.ObjectToStr(modelt__loop__id));
	templateBuilder.Append("\" type=\"hidden\" value=\"");
	templateBuilder.Append(Utils.ObjectToStr(goodsm.id));
	templateBuilder.Append("\" />\r\n                              </li>\r\n                              ");
	}
	else
	{

	templateBuilder.Append("\r\n                             <input id=\"Hidden2\" name=\"type");
	templateBuilder.Append(Utils.ObjectToStr(modelt__loop__id));
	templateBuilder.Append("\" type=\"hidden\" value=\"");
	templateBuilder.Append(Utils.ObjectToStr(goodsm.id));
	templateBuilder.Append("\" />\r\n                               <li>     <span class=\"tile\">订购类别：</span>\r\n<span>");
	templateBuilder.Append(Utils.ObjectToStr(goodsm.title));
	templateBuilder.Append("</span></li>\r\n<li> </li><li>\r\n\r\n                  <span class=\"tile\" >数量：</span>\r\n                  <input type=\"text\" value=\"");
	templateBuilder.Append(Utils.ObjectToStr(goodsm.quantity));
	templateBuilder.Append("\" title=\"");
	templateBuilder.Append(Utils.ObjectToStr(goodsm.price));
	templateBuilder.Append("\"  onblur=\"CartAmountTotal(this);\" id=\"number\" name=\"number");
	templateBuilder.Append(Utils.ObjectToStr(modelt__loop__id));
	templateBuilder.Append("\" class=\"tetinput_small\" />\r\n                  <span class=\"tet\">单位：张</span>\r\n                </li>\r\n                                ");
	}	//end for if

	if (modelt.type==2)
	{

	templateBuilder.Append("\r\n<input id=\"Hidden5\" type=\"hidden\" name=\"iscounte\" value=\"1\" />\r\n                                  \r\n                                   ");
	}	//end for if

	if (modelt.type!=2)
	{

	templateBuilder.Append("\r\n                              <li>\r\n                                <span class=\"tile\">\r\n                                  送达日期：\r\n                                </span>\r\n                                 \r\n                                   ");
	if (modelt.type==3)
	{

	templateBuilder.Append("\r\n                                    <input id=\"Hidden4\" type=\"hidden\"  name=\"date");
	templateBuilder.Append(Utils.ObjectToStr(modelt__loop__id));
	templateBuilder.Append("\" value=\"");	templateBuilder.Append(Utils.ObjectToDateTime(modelt.shiptime).ToString("yyyy-MM-dd"));

	templateBuilder.Append("\" />\r\n                                   <span> ");	templateBuilder.Append(Utils.ObjectToDateTime(modelt.shiptime).ToString("yyyy-MM-dd"));

	templateBuilder.Append("</span>\r\n     <span class=\"tet\"> 注：  送达日为排毒日前一天</span>\r\n                                ");
	}
	else
	{

	templateBuilder.Append("\r\n                                   <input class=\"tetinput el\"  name=\"date");
	templateBuilder.Append(Utils.ObjectToStr(modelt__loop__id));
	templateBuilder.Append("\" id=\"date");
	templateBuilder.Append(Utils.ObjectToStr(modelt__loop__id));
	templateBuilder.Append("\" type=\"text\" value=\"");	templateBuilder.Append(Utils.ObjectToDateTime(modelt.shiptime).ToString("yyyy-MM-dd"));

	templateBuilder.Append("\" />\r\n                                ");
	}	//end for if

	templateBuilder.Append("\r\n                              </li>\r\n                                ");
	if (modelt.type==3)
	{

	templateBuilder.Append("\r\n                              <li>\r\n                                <span class=\"tile\">\r\n                                  送达时间：\r\n                                </span>\r\n                                <span class=\"rule-single-select\">\r\n                                <select class=\"tetselect\"  name=\"time");
	templateBuilder.Append(Utils.ObjectToStr(modelt__loop__id));
	templateBuilder.Append("\" >\r\n                                  <option selected=\"\" value=\"1\">\r\n                                   2:00pm-6:00pm\r\n                                  </option>\r\n                                  <option value=\"2\">\r\n                                   6:00pm-10:00pm\r\n                                  </option>\r\n                                </select></span>\r\n                              </li>\r\n                              ");
	}	//end for if

	if (IsUserLogin())
	{

	templateBuilder.Append("\r\n                                <li>\r\n                                  <span class=\"tile\">\r\n                                    配送信息：\r\n                                  </span>\r\n                                  <span class=\"rule-single-select\">\r\n                                  <select class=\"tetselect  addrss\" name=\"address");
	templateBuilder.Append(Utils.ObjectToStr(modelt__loop__id));
	templateBuilder.Append("\" class=\"rule-single-select\" onchange=\"test(this)\">\r\n                                    ");
	DataTable list1 = get_user_address(userModel.id);

	int item__loop__id=0;
	foreach(DataRow item in list1.Rows)
	{
		item__loop__id++;

addcount++;

	templateBuilder.Append("\r\n                                        <option value=\"" + Utils.ObjectToStr(item["id"]) + "\" title=\"" + Utils.ObjectToStr(item["field1"]) + "\" ");
	if (Utils.ObjectToStr(item["status"])=="1")
	{

	if (Utils.ObjectToStr(item["field1"])=="50")
	{
addfive++;

	}	//end for if

	templateBuilder.Append("\r\n                                          selected=\"selected\"\r\n                                          ");
	}	//end for if

	templateBuilder.Append("\r\n                                            >" + Utils.ObjectToStr(item["address"]) + "--" + Utils.ObjectToStr(item["mobile"]) + "--");
	if (Utils.ObjectToStr(item["field1"])=="50")
	{

	templateBuilder.Append(" 五环外");
	}
	else
	{

	templateBuilder.Append("五环内");
	}	//end for if

	templateBuilder.Append("\r\n                                        </option>\r\n                                        \r\n                                        ");
	}	//end for if

	templateBuilder.Append("\r\n                                        <option value=\"0\">添加新地址</option>\r\n                                  </select></span>\r\n                                </li>\r\n                                ");
	}	//end for if

	}	//end for if

	templateBuilder.Append("\r\n                            </ul>\r\n                          </div>\r\n                          ");
	}	//end for if

	templateBuilder.Append("\r\n<input id=\"Hidden1\" name=\"addresscount\" value=\"");
	templateBuilder.Append(addcount.ToString());

	templateBuilder.Append("\" type=\"hidden\" />\r\n                        <input id=\"addcount\" name=\"addcount\" value=\"");
	templateBuilder.Append(modelt__loop__id.ToString());

	templateBuilder.Append("\" type=\"hidden\" />\r\n                            <input id=\"addfive\" name=\"addfive\" value=\"");
	templateBuilder.Append(addfive.ToString());

	templateBuilder.Append("\" type=\"hidden\" />\r\n                              <input id=\"ordertype\" name=\"ordertype\" type=\"hidden\" value=\"");
	templateBuilder.Append(ls1[0].type.ToString());

	templateBuilder.Append("\" />\r\n                    </div>\r\n                  </div>\r\n                </div>\r\n                <div class=\"right_con_m\">\r\n                  <p class=\"hotLineRight\">\r\n                    欢迎拨打\r\n                    <br />\r\n                    JuiceUp 客服热线：\r\n                    <br />\r\n                   400-082-5955<br />\r\n										（工作日9:00am-6:00pm）\r\n                  </p>\r\n                  <div class=\"orderConf\">\r\n                    <h5>\r\n                      确认您的订单：\r\n                    </h5>\r\n                    <div class=\"price\">\r\n                      产品：¥ <span id=\"goods_amount\">");
	templateBuilder.Append(Utils.ObjectToStr(cartModel.payable_amount));
	templateBuilder.Append("</span> RMB\r\n                    </div>\r\n                    <div class=\"shipping\">\r\n                      运费：¥ <span id=\"shipping\">0</span> RMB\r\n                    </div>\r\n                    ");
	if (ls1[0].type==3)
	{

	templateBuilder.Append("\r\n                    <div class=\"moreOrder\">\r\n                      <label class=\"tile\">\r\n                        <input type=\"checkbox\"   class=\"checkall\"  name=\"\" id=\"cbox\" value=\"radio\" />\r\n                        多人订购 优惠更多\r\n                      </label>\r\n                      <div id=\"moreOrderInfo\">\r\n                        <div>\r\n                          输入人数 最终价格会便宜哦\r\n                        </div>\r\n                        <div class=\"moreOrder_l\">\r\n                          <img class=\"floatleft\" src=\"");
	templateBuilder.Append("/templates/JuiceUp");
	templateBuilder.Append("/images/icon_x.gif\" width=\"22\" height=\"28\"\r\n                          />\r\n                          <input class=\"tetinput_sl\" disabled=\"disabled\" id=\"multiTEXT\" name=\"multi\" type=\"text\" value=\"\"\r\n                          />\r\n                          <input type=\"button\"   value=\"提交\" id=\"sbu\"  onclick=\"HowAmountTotal()\" class=\"btn\" style=\"background-color: #BEBEBE;\"   />\r\n                        </div>\r\n                      </div>\r\n                    </div>\r\n           <div class=\"orderGift\">\r\n                      <div>\r\n                        <label class=\"tile\">\r\n                          <input type=\"checkbox\"   class=\"checkall\" id=\"cbox2\" name=\"\" value=\"radio\" />\r\n                          礼品卡\r\n                        </label>\r\n                        <input\r\n                      class=\"btn\" id=\"libtn\" disabled=\"disabled\" style=\"background-color: #BEBEBE;\"  value=\"验证\" type=\"button\" onclick=\"lipinTotal();\"   /> \r\n                      </div>\r\n                      <input class=\"tetinput\" disabled=\"disabled\" id=\"liping\" name=\"liping\" placeholder=\"请输入相对应的礼品卡编码\"  type=\"text\"\r\n                      value=\"\" />\r\n                    </div>\r\n                    <div class=\"orderDiscount\">\r\n                      <div>\r\n                        <label class=\"tile\">\r\n                          <input type=\"checkbox\" class=\"checkall\" id=\"cok1\" name=\"\"  value=\"radio\" />\r\n                          优惠卡\r\n                        </label>\r\n                        <input class=\"btn\" id=\"zhe\" style=\"background-color: #BEBEBE;\"  value=\"验证\" type=\"button\"   onclick=\"zheTotal();\"/>\r\n                          \r\n                        \r\n                      </div>\r\n<input class=\"tetinput\" name=\"zhe\" id=\"ku\" type=\"text\" disabled=\"disabled\" value=\"\"  placeholder=\"请输入相对应的优惠码\" />\r\n                    </div>\r\n                     \r\n                    <div class=\"payingPrice\">\r\n                      <span>\r\n                        应付价格：\r\n                      </span>\r\n                      ¥ <span id=\"order_amount\" style=\"display:inline\">");
	templateBuilder.Append(Utils.ObjectToStr(cartModel.payable_amount));
	templateBuilder.Append("</span> RMB\r\n                    </div>\r\n                    ");
	}	//end for if

	templateBuilder.Append("\r\n                     <input id=\"ddr\" value=\"");
	templateBuilder.Append(Utils.ObjectToStr(cartModel.payable_amount));
	templateBuilder.Append("\" type=\"hidden\" />\r\n                    <div class=\"paymentList\">\r\n                      <h6>\r\n                        支付方式\r\n                      </h6>\r\n                      ");
	string strwhere="is_lock = 0";

	if (ls1[0].type==1||ls1[0].type==2)
	{
strwhere=strwhere+" and id!=1";  

	}	//end for if

	DataTable list2 = get_payment_list(0, strwhere);

	int dr1__loop__id=0;
	foreach(DataRow dr1 in list2.Rows)
	{
		dr1__loop__id++;


	templateBuilder.Append("\r\n    \r\n                      <label>\r\n                      <input name=\"payment_id\" type=\"radio\" ");
	if (Utils.ObjectToStr(dr1["title"])=="在线支付")
	{

	templateBuilder.Append("  checked=\"checked\"");
	}	//end for if

	templateBuilder.Append(" value=\"" + Utils.ObjectToStr(dr1["id"]) + "\" />\r\n                        \r\n                        " + Utils.ObjectToStr(dr1["title"]) + "\r\n                      </label>\r\n                      ");
	}	//end for if

	templateBuilder.Append("\r\n                    </div>\r\n                    <div class=\"btn_next\" >\r\n                         <input id=\"btnSubmit\" name=\"btnSubmit\" type=\"submit\" value=\"确认提交\" class=\"btn btn-success marL10\" />\r\n                      <!--<a href=\"javascript:void(0);\">\r\n                        确认支付\r\n                      </a>-->\r\n                    </div>\r\n                      <input id=\"vids\" value=\"0\" type=\"hidden\" />\r\n                  </div>\r\n                   <!--right-->\r\n                ");

	templateBuilder.Append("\r\n<h4 class=\"darkGreen\">\r\n  温馨提示：\r\n</h4>\r\n<div class=\"reminder_right idTabs\">\r\n  <div class=\"item\">\r\n    <h5>\r\n      <a href=\"javascript:void(0);\" onClick=\"DivSwitch(this)\"  class=\"selected\">\r\n        订购及饮用时间\r\n        <span class=\"icon_r\">\r\n        </span>\r\n      </a>\r\n    </h5>\r\n    <div id=\"reminder_item01\" class=\"info\" style=\"display:block;\">\r\n   \r\n\r\n <p>1. JuiceUp果汁内没有任何的防腐成分或添加剂，所以为了保证果汁的新鲜品质，请您务必在所选排毒日当日将果汁饮用完毕。</p>\r\n\r\n      <p>\r\n        2.敬请在排毒日前至少2个工作日作出订购。例如您想在星期三开始排毒，则需在星期一12:00pm前订购，我们便会在星期二把果汁送达府上。<span style=\"color: #007930;\">（周六/日及法定假日暂无法安排配送，敬请谅解）</span>\r\n      </p>\r\n      <p>\r\n       3.	我们建议您在所选排毒日期前一个星期预定蔬果汁，以确保您有足够的时间阅读并实施“排毒前注意事项”，预先调整饮食习惯，可令疗程的效果更佳显著，也可避免旺季时无法满足您的需求。\r\n      </p>\r\n      <p>4.	为了确保蔬果汁的品质，JuiceUp对蔬果的选材要求极为严苛，所以每日仅限量供应300套，售完即止，敬请谅解。</p>\r\n     \r\n    </div>\r\n  </div>\r\n  <div class=\"item\">\r\n    <h5>\r\n      <a href=\"javascript:void(0);\" onClick=\"DivSwitch(this)\">\r\n        更改及取消\r\n        <span class=\"icon_r\">\r\n        </span>\r\n      </a>\r\n    </h5>\r\n    <div id=\"reminder_item02\" class=\"info\">\r\n      <p>\r\n              1.	由于套餐中的每支果汁都是新鲜制作，所以在确认订购后，我们无法接受对果汁系列的任何更改。\r\n      </p>\r\n      <p>\r\n2.	如遇特殊情况需修改排毒日期，请在原定排毒日期前至少2个工作日在系统中进行修改，每次订购仅限一次修改。（需确保修改后的排毒日期距修改当日至少2个工作日）</p>\r\n   <p>3.	订单确认后，我们无法做出任何退款，敬请谅解。</p>\r\n\r\n    </div>\r\n  </div>\r\n  <div class=\"item\">\r\n    <h5>\r\n      <a href=\"javascript:void(0);\" onClick=\"DivSwitch(this)\">\r\n        多人订购优惠方法\r\n        <span class=\"icon_r\">\r\n        </span>\r\n      </a>\r\n    </h5>\r\n    <div id=\"reminder_item03\" class=\"info\">\r\n     <p>  朋友、伴侣、家人、同事，甚至是结婚姐妹团，让大家一起成为排毒拍档吧！\r\n我们欢迎大家以团体形式参与排毒疗程并获得相应优惠。研究及经验表明，在大家相互的鼓励及监督下，排毒过程将变得更富有乐趣也更容易坚持，令人惊喜的是，结伴排毒时，效果也更加显著！\r\n</p>\r\n<p>\r\n3人或以上订购可享有9.5折优惠；<br />\r\n5人或以上订购可享有9折优惠；<br />\r\n8人或以上订购可享有8.5折优惠<br />\r\n(限同一个送货日期、地址及同一系列的排毒果汁)\r\n\r\n   \r\n    \r\n      </p>\r\n    </div>\r\n  </div>\r\n  <!--<div class=\"item\">\r\n    <h5>\r\n      <a href=\"javascript:void(0);\" onClick=\"DivSwitch(this)\">\r\n        索要发票方式\r\n        <span class=\"icon_r\">\r\n        </span>\r\n      </a>\r\n    </h5>\r\n    <div id=\"reminder_item04\" class=\"info\">\r\n      <p>\r\n        们建议您在所选排毒日期前一个星期预定疗程\r\n      </p>\r\n    </div>\r\n  </div>-->\r\n  <div class=\"item\">\r\n   <h5>\r\n      <a href=\"javascript:void(0);\" onClick=\"DivSwitch(this)\">\r\n        礼品卡/优惠卡使用\r\n        <span class=\"icon_r\">\r\n        </span>\r\n      </a>\r\n    </h5>\r\n     <div id=\"reminder_item05\" class=\"info\">\r\n      <p>\r\n        若您有礼品卡代码或优惠卡代码，请直接选购您所需的果汁，只需在支付前输入相应代码即可,选择货到付款时无法使用优惠卡和礼品卡\r\n      </p>\r\n    </div>\r\n  </div>\r\n</div>");


	templateBuilder.Append("\r\n                  <!--/right-->\r\n            \r\n                </div>\r\n                  <script src=\"");
	templateBuilder.Append("/templates/JuiceUp");
	templateBuilder.Append("/js/jquery.ui.core.js\" type=\"text/javascript\"></");
	templateBuilder.Append("script>\r\n                 <script src=\"");
	templateBuilder.Append("/templates/JuiceUp");
	templateBuilder.Append("/js/jquery.ui.datepicker.js\"></");
	templateBuilder.Append("script>\r\n<script src=\"");
	templateBuilder.Append("/templates/JuiceUp");
	templateBuilder.Append("/js/jquery.ui.datepicker-zh-TW.js\"></");
	templateBuilder.Append("script>\r\n<script type=\"text/javascript\" src=\"");
	templateBuilder.Append("/templates/JuiceUp");
	templateBuilder.Append("/js/layout.js\"></");
	templateBuilder.Append("script>\r\n<script type=\"text/javascript\" src=\"../../scripts/lhgdialog/lhgdialog.js?skin=idialog_1\"></");
	templateBuilder.Append("script>\r\n<script type=\"text/javascript\" src=\"");
	templateBuilder.Append("/templates/JuiceUp");
	templateBuilder.Append("/js/base.js\"></");
	templateBuilder.Append("script>\r\n<link rel=\"stylesheet\" href=\"");
	templateBuilder.Append(Utils.ObjectToStr(config.webpath));
	templateBuilder.Append("css/validate.css\" />\r\n	<script type=\"text/javascript\" src=\"");
	templateBuilder.Append(Utils.ObjectToStr(config.webpath));
	templateBuilder.Append("scripts/jquery/jquery.form.min.js\"></");
	templateBuilder.Append("script>\r\n    <script type=\"text/javascript\" src=\"");
	templateBuilder.Append(Utils.ObjectToStr(config.webpath));
	templateBuilder.Append("scripts/jquery/Validform_v5.3.2_min.js\"></");
	templateBuilder.Append("script>\r\n                <script  type=\"text/javascript\">\r\n                	Date.prototype.Format = function (fmt) { //author: meizz \r\n		        var o = {\r\n		            \"M+\": this.getMonth() + 1, //月份 \r\n		            \"d+\": this.getDate(), //日 \r\n		            \"h+\": this.getHours(), //小时 \r\n		            \"m+\": this.getMinutes(), //分 \r\n		            \"s+\": this.getSeconds(), //秒 \r\n		            \"q+\": Math.floor((this.getMonth() + 3) / 3), //季度 \r\n		            \"S\": this.getMilliseconds() //毫秒 \r\n		        };\r\n		        if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + \"\").substr(4 - RegExp.$1.length));\r\n		        for (var k in o)\r\n		            if (new RegExp(\"(\" + k + \")\").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : ((\"00\" + o[k]).substr((\"\" + o[k]).length)));\r\n		        return fmt;\r\n		    }\r\n              ");
	if (ls1[0].type==3)
	{

	templateBuilder.Append("\r\n                $(function(){if($(\"#addfive\").val()!=\"0\")\r\n                {\r\n\r\n                $(\"#shipping\").text($(\"#addfive\").val()*50);\r\n                 \r\n                }\r\n                var goods_amount = $(\"#goods_amount\").text(); //商品总金额\r\n               var d=$(\"#shipping\").text();\r\n               \r\n                  var order_amount=parseFloat(goods_amount)+parseFloat(d);\r\n                  \r\n          \r\n        $(\"#order_amount\").text(order_amount.toFixed(2));\r\n                });\r\n                ");
	}	//end for if

	templateBuilder.Append("\r\n                 //计算订单总金额\r\nfunction HowAmountTotal() {\r\n\r\n    var temp = $(\"#multiTEXT\");\r\n        if (isNaN(temp.val())) {\r\n            alert('多人订购只能输入数字!');\r\n            temp.focus();\r\n            return;\r\n        }\r\n       \r\n         Calculate();\r\n\r\n    \r\n\r\n\r\n}\r\nfunction zheTotal() {\r\n\r\n    var temp = $(\"#ku\");\r\n        if (temp.val()==\"\") {\r\n            alert('您输入的内容不能为空!');\r\n            temp.focus();\r\n            return;\r\n        }\r\n       \r\n         Calculate();\r\n\r\n}\r\n\r\nfunction lipinTotal() {\r\n\r\n    var temp = $(\"#liping\");\r\n        if (temp.val()==\"\") {\r\n            alert('您输入的内容不能为空!');\r\n            temp.focus();\r\n            return;\r\n        }\r\n       \r\n         Calculate();\r\n\r\n}\r\n                    $(function () {\r\n                      //表单提交\r\n          AjaxInitForm('order_form', 'btnSubmit', 0);\r\n                   $(\"#cbox\").click(function(){\r\n                    $(\".checkall\").prop(\"checked\", false);\r\n        $(this).prop(\"checked\", true);\r\n                   if(document.getElementById(\"cbox\").checked)\r\n                   {\r\n                   $(\"#zhe\").attr(\"disabled\",\"true\");\r\n                    $(\"#ku\").attr(\"disabled\",\"true\");\r\n               $(\"#ku\").val(\"\");\r\n                  $(\"#zhe\").css(\"background-color\",\"#BEBEBE\");\r\n                     $(\"#multiTEXT\").removeAttr(\"disabled\");\r\n                   $(\"#sbu\").removeAttr(\"disabled\");\r\n                   $(\"#sbu\").css(\"background-color\",\"#007930\");\r\n                     $(\"#liping\").attr(\"disabled\",\"true\");\r\n                    $(\"#libtn\").attr(\"disabled\",\"true\");\r\n                     $(\"#liping\").val(\"\");\r\n                  $(\"#libtn\").css(\"background-color\",\"#BEBEBE\");\r\n                   Calculate();\r\n                   }else\r\n                   {\r\n                     $(\"#multiTEXT\").attr(\"disabled\",\"true\");\r\n                    $(\"#sbu\").attr(\"disabled\",\"true\");\r\n                 \r\n                  $(\"#sbu\").css(\"background-color\",\"#BEBEBE\")\r\n                   }\r\n                    }\r\n                    );\r\n                     $(\"#cok1\").click(function(){\r\n                    $(\".checkall\").prop(\"checked\", false);\r\n        $(this).prop(\"checked\", true);\r\n                   if(document.getElementById(\"cok1\").checked)\r\n                   {\r\n                     $(\"#zhe\").removeAttr(\"disabled\");\r\n                   $(\"#ku\").removeAttr(\"disabled\");\r\n                   $(\"#zhe\").css(\"background-color\",\"#007930\")\r\n                     $(\"#multiTEXT\").attr(\"disabled\",\"true\");\r\n                    $(\"#sbu\").attr(\"disabled\",\"true\");\r\n                  $(\"#multiTEXT\").val(\"\");\r\n                  $(\"#sbu\").css(\"background-color\",\"#BEBEBE\");\r\n                   $(\"#liping\").attr(\"disabled\",\"true\");\r\n                    $(\"#libtn\").attr(\"disabled\",\"true\");\r\n                     $(\"#liping\").val(\"\");\r\n                  $(\"#libtn\").css(\"background-color\",\"#BEBEBE\");\r\n                  Calculate();\r\n                   }else\r\n                   {\r\n                     $(\"#zhe\").attr(\"disabled\",\"true\");\r\n                    $(\"#ku\").attr(\"disabled\",\"true\");\r\n                 \r\n                  $(\"#zhe\").css(\"background-color\",\"#BEBEBE\");\r\n                   }\r\n                    }\r\n                    );\r\n                        $(\"#cbox2\").click(function(){\r\n                    $(\".checkall\").prop(\"checked\", false);\r\n        $(this).prop(\"checked\", true);\r\n                   if(document.getElementById(\"cbox2\").checked)\r\n                   {\r\n                     $(\"#liping\").removeAttr(\"disabled\");\r\n                   $(\"#libtn\").removeAttr(\"disabled\");\r\n                   $(\"#libtn\").css(\"background-color\",\"#007930\")\r\n                     $(\"#multiTEXT\").attr(\"disabled\",\"true\");\r\n                    $(\"#sbu\").attr(\"disabled\",\"true\");\r\n                  $(\"#multiTEXT\").val(\"\");\r\n                  $(\"#sbu\").css(\"background-color\",\"#BEBEBE\");\r\n                    $(\"#zhe\").attr(\"disabled\",\"true\");\r\n                    $(\"#ku\").attr(\"disabled\",\"true\");\r\n               $(\"#ku\").val(\"\");\r\n                  $(\"#zhe\").css(\"background-color\",\"#BEBEBE\");\r\n                  Calculate();\r\n                   }else\r\n                   {\r\n                     $(\"#liping\").attr(\"disabled\",\"true\");\r\n                    $(\"#libtn\").attr(\"disabled\",\"true\");\r\n                 \r\n                  $(\"#libtn\").css(\"background-color\",\"#BEBEBE\");\r\n                   }\r\n                    }\r\n                    );\r\n//                        var myDate = new Date();\r\n//                      if(new Date().getHours()<12)\r\n//	        {\r\n//	        myDate.setDate(myDate.getDate() + 2);\r\n//	        }\r\n//	        else\r\n//	        {\r\n//	          myDate.setDate(myDate.getDate() + 3);\r\n//	        }\r\n//                     	var ellength=$( \".ddd\" ).length;\r\n//myDate.setDate(myDate.getDate() -1);\r\n");
	int starti = ls1.Count;

	templateBuilder.Append("\r\nvar starti=");
	templateBuilder.Append(Utils.ObjectToStr(starti));
	templateBuilder.Append(";\r\n                           $( \".el\" ).each(function(){\r\n						    ");
	if (ls1[0].type==3)
	{

	templateBuilder.Append("\r\n						 var dd=testwile(starti);\r\n                         ");
	}
	else
	{

	templateBuilder.Append("\r\n                         var dd=new Date();\r\n                          dd.setDate(dd.getDate() + 2);\r\n                         ");
	}	//end for if

	templateBuilder.Append("\r\n						  $(this).datepicker({\r\n			\"minDate\":  dd,\r\n                                showOtherMonths: true,\r\n                                selectOtherMonths: true,\r\n                                 beforeShowDay: function (date) {\r\n	               \r\n	                    return selectedDate(date, starti, 0);\r\n	              \r\n\r\n	            }\r\n		});\r\n						  \r\n						  \r\n   \r\n  });\r\n                          \r\n                       ");
	if (!IsUserLogin())
	{

	templateBuilder.Append("\r\n                       login();\r\n                   ");
	}
	else
	{

	if (addcount==0)
	{

	if (ls1.Count==0)
	{

	templateBuilder.Append("\r\n                  \r\n                     window.location.href=\"goods.aspx\";\r\n                     ");
	}	//end for if

	if (ls1[0].time!=1)
	{

	templateBuilder.Append("\r\n                     user_address_add();\r\n                    ");
	}	//end for if

	}	//end for if

	}	//end for if

	templateBuilder.Append("\r\n                    });\r\n                    function user_address_add()\r\n                    {\r\n                    var dialog = $.dialog({\r\n                   title:\"请添加收货地址\",\r\n                   content: \"url:");
	templateBuilder.Append(linkurl("accept"));

	templateBuilder.Append("\",\r\n                   min: false,\r\n                   max: false,\r\n                    lock: true,\r\n                  close:function(){ location.reload(true);}\r\n                  \r\n                  });\r\n                    }\r\n                    \r\n                    function test(obj)\r\n                    {\r\n                    if($(obj).val()==\"0\")\r\n                    {\r\n                     user_address_add();\r\n                    }\r\n                    else\r\n                    {\r\n                     ");
	if (ls1[0].type==3)
	{

	templateBuilder.Append("\r\n                      Calculate();\r\n                      ");
	}	//end for if

	templateBuilder.Append("\r\n                    }\r\n                    }\r\n                    function Calculate()\r\n{\r\n  var goods_amount = $(\"#ddr\").val(); //商品总金额\r\n        //手续费\r\n       var order_amount = goods_amount;\r\n      \r\n         if($(\"#multiTEXT\").val()!=\"\")\r\n         {\r\n           var temp = $(\"#multiTEXT\");\r\n          var payment_fee = temp.val();\r\n           var order_amount = goods_amount * payment_fee;\r\n       \r\n        if(payment_fee>=8)\r\n        {\r\n          var order_amount = order_amount *0.85;\r\n      \r\n        }\r\n        else if(payment_fee>=5)\r\n        {\r\n        var order_amount = order_amount *0.90;\r\n        }\r\n        else if(payment_fee>=3)\r\n        {\r\n         var order_amount = order_amount *0.95;\r\n        }\r\n        }else\r\n        {\r\n       var order_amount=goods_amount;\r\n       \r\n        }\r\n        var zhe=$(\"#ku\").val();\r\n        var liping=$(\"#liping\").val();\r\n        if(zhe!=\"\")\r\n        {\r\n        $.ajax({\r\n            type: \"post\",\r\n            url: \"");
	templateBuilder.Append(Utils.ObjectToStr(config.webpath));
	templateBuilder.Append("tools/submit_ajax.ashx?action=theyard\",\r\n            data:{ \"sn\" : zhe,\"type\":\"zhe\"},\r\n            dataType: \"json\",\r\n            error: function (XMLHttpRequest, textStatus, errorThrown) {\r\n                $.dialog.alert('尝试发送失败，错误信息：' + errorThrown, function () { }, winObj);\r\n            },\r\n            success: function (data, textStatus) {\r\n           \r\n                if (data.status == \"1\") {\r\n                var order_amount = $(\"#ddr\").val();\r\n\r\n                if($(\"#addcount\").val()==\"1\")\r\n                {\r\n              if(data.code==\"1天\")\r\n              {\r\n                 if(data.sn==\"8.5\")\r\n                {\r\n              \r\n                 var order_amount = order_amount *0.85;\r\n                  \r\n                }else\r\n                {\r\n               \r\n                  var order_amount = order_amount *0.50;\r\n                   \r\n                }\r\n                  }else\r\n                  {\r\n                  alert(\"您所使用的是3天折扣码,请重新选择您的计划!\");\r\n                  }\r\n                }else\r\n                {\r\n               \r\n                   if(data.code==\"3天\")\r\n              {\r\n                if(data.sn==\"8.5\")\r\n                {\r\n              \r\n                 var order_amount = order_amount *0.85;\r\n                  \r\n                }else\r\n                {\r\n               \r\n                  var order_amount = order_amount *0.50;\r\n                   \r\n                }\r\n                  }else\r\n                  {\r\n                    alert(\"您所使用的是1天折扣码,请重新选择您的计划!\");\r\n                  }\r\n                   \r\n                }\r\n                \r\n               \r\n             \r\n              \r\n          var d = $(\".addrss\");\r\n       \r\n        var v = 0;\r\n         $(\"#addfive\").val(0);\r\n       for(var i=0; i < d.length; i++) {\r\n     \r\n          var ddrsc=$(d[i]).find(\"option:selected\").attr(\"title\");\r\n     if(ddrsc==\"50\")\r\n     {\r\n          v=v+=parseFloat(50);\r\n        $(\"#addfive\").val(parseInt($(\"#addfive\").val())+1);\r\n          }\r\n      }\r\n     // alert(parseFloat(order_amount).toFixed(2));\r\n      $(\"#shipping\").text(v);\r\n         $(\"#goods_amount\").text(parseFloat(order_amount).toFixed(2));\r\n        var order_amount=parseFloat(order_amount)+parseFloat($(\"#shipping\").text());\r\n         \r\n        $(\"#order_amount\").text(order_amount.toFixed(2));\r\n                } else {\r\n                  alert(data.msg);\r\n                }\r\n            }\r\n        });\r\n        }\r\n        else if(liping!=\"\")\r\n        {\r\n         $.ajax({\r\n            type: \"post\",\r\n            url: \"");
	templateBuilder.Append(Utils.ObjectToStr(config.webpath));
	templateBuilder.Append("tools/submit_ajax.ashx?action=theyard\",\r\n            data:{ \"sn\" : liping,\"type\":\"li\"},\r\n            dataType: \"json\",\r\n            error: function (XMLHttpRequest, textStatus, errorThrown) {\r\n                $.dialog.alert('尝试发送失败，错误信息：' + errorThrown, function () { }, winObj);\r\n            },\r\n            success: function (data, textStatus) {\r\n           \r\n                if (data.status == \"1\") {\r\n                var order_amount = $(\"#ddr\").val();\r\n                if($(\"#addcount\").val()==\"1\")\r\n                {\r\n              if(data.sn==\"1天\")\r\n              {\r\n                 var order_amount =0;\r\n                  }else\r\n                  {\r\n                  alert(\"您所使用的是3天礼品码,请重新选择您的计划!\");\r\n                  }\r\n                }else\r\n                {\r\n               \r\n                   if(data.sn==\"3天\")\r\n              {\r\n                 var order_amount =0;\r\n                  }else\r\n                  {\r\n                    alert(\"您所使用的是1天礼品码,请重新选择您的计划!\");\r\n                  }\r\n                   \r\n                }\r\n               \r\n             \r\n              \r\n          var d = $(\".addrss\");\r\n       \r\n        var v = 0;\r\n         $(\"#addfive\").val(0);\r\n       for(var i=0; i < d.length; i++) {\r\n     \r\n          var ddrsc=$(d[i]).find(\"option:selected\").attr(\"title\");\r\n     if(ddrsc==\"50\")\r\n     {\r\n          v=v+=parseFloat(50);\r\n        $(\"#addfive\").val(parseInt($(\"#addfive\").val())+1);\r\n          }\r\n      }\r\n     // alert(parseFloat(order_amount).toFixed(2));\r\n      $(\"#shipping\").text(v);\r\n         $(\"#goods_amount\").text(parseFloat(order_amount).toFixed(2));\r\n        var order_amount=parseFloat(order_amount)+parseFloat($(\"#shipping\").text());\r\n         \r\n        $(\"#order_amount\").text(order_amount.toFixed(2));\r\n                } else {\r\n                  alert(data.msg);\r\n                }\r\n            }\r\n        });\r\n        }\r\n        else\r\n        {\r\n       \r\n         var d = $(\".addrss\");\r\n       \r\n        var v = 0;\r\n         $(\"#addfive\").val(0);\r\n       for(var i=0; i < d.length; i++) {\r\n     \r\n          var ddrsc=$(d[i]).find(\"option:selected\").attr(\"title\");\r\n     if(ddrsc==\"50\")\r\n     {\r\n          v=v+=parseFloat(50);\r\n        $(\"#addfive\").val(parseInt($(\"#addfive\").val())+1);\r\n          }\r\n      }\r\n     // alert(parseFloat(order_amount).toFixed(2));\r\n      $(\"#shipping\").text(v);\r\n         $(\"#goods_amount\").text(parseFloat(order_amount).toFixed(2));\r\n        var order_amount=parseFloat(order_amount)+parseFloat($(\"#shipping\").text());\r\n         \r\n        $(\"#order_amount\").text(order_amount.toFixed(2));\r\n        }\r\n}\r\n                   //发送AJAX请求\r\n    function sendAjaxUrl(winObj, postData, sendUrl) {\r\n        $.ajax({\r\n            type: \"post\",\r\n            url: sendUrl,\r\n            data: postData,\r\n            dataType: \"json\",\r\n            error: function (XMLHttpRequest, textStatus, errorThrown) {\r\n                $.dialog.alert('尝试发送失败，错误信息：' + errorThrown, function () { }, winObj);\r\n            },\r\n            success: function (data, textStatus) {\r\n                if (data.status == 1) {\r\n                    winObj.close();\r\n                    $.dialog.tips(data.msg, 2, '32X32/succ.png', function () { location.reload(); }); //刷新页面\r\n                } else {\r\n                    $.dialog.alert('错误提示：' + data.msg, function () { }, winObj);\r\n                }\r\n            }\r\n        });\r\n    }\r\n                    function login()\r\n                    {\r\n                    \r\n              \r\n               var dialog = $.dialog({\r\n                  title:\"登录\",\r\n                   content: \"url:");
	templateBuilder.Append(linkurl("divlogin"));

	templateBuilder.Append("\",\r\n                   min: false,\r\n                   max: false,\r\n                   lock: true\r\n                  \r\n                    });\r\n                    }\r\n                \r\n              var dateall=[];\r\nfunction dateadd(date,i)\r\n{\r\nfor(var j=0; j<i;j++) {\r\n    dateall.push(new  Date(date.setDate(date.getDate() + 1)));\r\n}\r\n}\r\nfunction tests(datep,type,i) {\r\n    if(dateall.length==0)\r\n    {\r\n    var setdate = new Date();\r\n    setdate.setFullYear(2014, 3, 6);\r\n\r\n    dateadd(setdate, 2+i);\r\n    if(type==3)\r\n    {\r\n    setdate.setFullYear(2014, 3, 29);\r\n    }else\r\n    {\r\n     setdate.setFullYear(2014, 3, 30);\r\n    }\r\n    dateadd(setdate, 3+i);\r\n    if(type==3)\r\n    {\r\n    setdate.setFullYear(2014, 4, 30);\r\n    }else\r\n    {\r\n    setdate.setFullYear(2014, 4, 31);\r\n    }\r\n    dateadd(setdate, 3+i);\r\n    if(type==3)\r\n    {\r\n    setdate.setFullYear(2014, 8, 5);\r\n    }else\r\n    {\r\n      setdate.setFullYear(2014, 8, 6);\r\n    }\r\n    dateadd(setdate, 3+i);\r\n    if(type==3)\r\n    {\r\n    setdate.setFullYear(2014, 8, 30);\r\n    }else\r\n    {\r\n    setdate.setFullYear(2014, 9, 1);\r\n    }\r\n    dateadd(setdate, 7+i);\r\n   }\r\n    for (var i=0; i<dateall.length; i++)\r\n    {\r\n        if (new Date(dateall[i]).Format(\"yyyy-MM-dd\") == datep.Format(\"yyyy-MM-dd\")) {\r\n            return true;\r\n        }\r\n       \r\n       // alert(new Date(dateall[i]).Format(\"yyyy-MM-dd\"));\r\n\r\n    }\r\n    return false;\r\n}\r\nfunction selectedDate(date, type, i) {\r\n\r\n\r\n\r\n    var d = date.getDay();\r\n    var ret=[true,'hasCourse'];\r\n    if (tests(date, type, i)) {\r\n      return [false, 'noCourse'];\r\n    }\r\n    if (type == 3) {\r\n        if (d == 0 || d == 6 || d == 5 || d == 1) {\r\n          return [false, 'noCourse'];\r\n\r\n        }\r\n    }\r\n    else {\r\n        if (d == 0 || d ==6) {\r\n           return [false, 'noCourse'];\r\n\r\n        }\r\n        \r\n    }\r\n\r\n\r\n    return ret;\r\n}\r\n function testwile(type) {\r\n	        var myDate = new Date();\r\n\r\n	        if (new Date().getHours() < 12) {\r\n	            myDate.setDate(myDate.getDate() + 2);\r\n	        }\r\n	        else {\r\n	            myDate.setDate(myDate.getDate() + 3);\r\n	        }\r\n	        if (type == 3) {\r\n	            while (selectedDate(myDate, 3, 0)[0] == false) {\r\n	                myDate.setDate(myDate.getDate() + 1);\r\n	            }\r\n	        }\r\n	       return myDate;\r\n	        \r\n	    }    \r\n	</");
	templateBuilder.Append("script>\r\n               </div>\r\n               </form>\r\n</div>\r\n            <!--Footer-->\r\n            ");

	templateBuilder.Append(" <div id=\"footer_modules\">\r\n ");
	if (indexv==1)
	{

	templateBuilder.Append("\r\n <div class=\"ind_news\">\r\n <style>\r\n\r\n  .focus_tab{margin:4px auto 0;position:relative;  }\r\n  .focusPic{width:708px;overflow:hidden; margin-left: auto;\r\nmargin-right: auto;}\r\n\r\n\r\n\r\n.sidePic{float:right;list-style:none;}\r\n .sidePic li{\r\n	 width:21px;text-align:center;height:24px;line-height:26px;float:left;margin-right:7px;color:#2B2B2B; background: cursor:pointer;\r\n }\r\n.focus_tab .normal{float:left;margin-right:10px;}\r\n  </style>\r\n     <div id=\"s\"  class=\"focusPic\">\r\n        <div id=\"noticeList\" class=\"focus_tab\">\r\n          ");
	DataTable category_list2 = get_article_list("news", 39, 10, "status=0", "click desc,id desc");

	int cdr2__loop__id=0;
	foreach(DataRow cdr2 in category_list2.Rows)
	{
		cdr2__loop__id++;


	templateBuilder.Append("\r\n          <span class=\"normal\">" + Utils.ObjectToStr(cdr2["content"]) + "</span>\r\n          ");
	}	//end for if

	templateBuilder.Append("\r\n        </div>\r\n     </div>\r\n          \r\n  	 <div><a class=\"btn\" href=\"");
	templateBuilder.Append(linkurl("goods"));

	templateBuilder.Append("\">选择您的排毒计划</a> </div>\r\n  </div>\r\n\r\n<script type=\"text/javascript\">\r\n\r\n $(function(){\r\n	var itemWidth=$(\".focus_tab > .normal\").width()+10;\r\n	var sumWidth=itemWidth*$(\".focus_tab > .normal\").length;\r\n	var temp=$(\".focus_tab > div\").clone();\r\n	temp.appendTo(\".focus_tab\");\r\n	$(\".focus_tab\").width(sumWidth*2);\r\n	var i=0;\r\n	setInterval(play,18);\r\n	function play(){\r\n		//$(\".focus_tab\").offset({left:i,top:$(\".focus_tab\").offset().top});\r\n		$(\".focus_tab\").css(\"left\",i)\r\n		i-=1;\r\n		//if(Math.abs($(\".focus_tab\").offset().left)>=sumWidth)\r\n		if(Math.abs(parseInt($(\".focus_tab\").css(\"left\")))>=sumWidth){\r\n			i=0;\r\n		}\r\n	}\r\n });\r\n\r\n    	   \r\n	</");
	templateBuilder.Append("script>\r\n    ");
	}	//end for if

	templateBuilder.Append("\r\n   <script type=\"text/javascript\" src=\"");
	templateBuilder.Append(Utils.ObjectToStr(config.webpath));
	templateBuilder.Append("scripts/lhgdialog/lhgdialog.js?skin=idialog_1\">\r\n      </");
	templateBuilder.Append("script>\r\n      <script type=\"text/javascript\">\r\n       //放大图片\r\n       $(function () {\r\n           \r\n           $(\".imgtip\").click(function (e) {\r\n              \r\n               var dialog = $.dialog({\r\n                   title: '查看二维码',\r\n                   content: \"<img src='");
	templateBuilder.Append("/templates/JuiceUp");
	templateBuilder.Append("/images/weixin-01.jpg' />\",\r\n                   min: false,\r\n                   max: false,\r\n                  lock: true,\r\n                   width: 200,\r\n                   height: 200\r\n               });\r\n           });\r\n         \r\n       });\r\n       function divshow(str)\r\n       {\r\n        \r\n              \r\n               var dialog = $.dialog({\r\n                   title: str,\r\n                   content: \"<div class='layer_giftCard'><div class='gc_right_con'> <p>\"+str+\"敬请期待</p></div></div> \",\r\n                   min: false,\r\n                   max: false,\r\n                  lock: true,\r\n                   width: 100,\r\n                   height: 100\r\n               });\r\n          \r\n       }\r\n</");
	templateBuilder.Append("script>\r\n  <script>\r\n                function submitTest() {\r\n                    if ($(\"#pad\").val() == \"\")\r\n                    { return false; }\r\n                    else {\r\n                        location.href = 'feedback.aspx?con=' + $('#pad').val();\r\n                        //return true;\r\n                    }\r\n                }\r\n</");
	templateBuilder.Append("script>\r\n    <div class=\"social\">\r\n      <div class=\"socialWrapper\">\r\n      <a href=\"http://weibo.com/juiceupcleanse\"><img src=\"");
	templateBuilder.Append("/templates/JuiceUp");
	templateBuilder.Append("/images/sinaIcon.png\" /><em>官方微博</em></a>\r\n      <a href=\"javascript:void(0);\" class=\"imgtip\"><img src=\"");
	templateBuilder.Append("/templates/JuiceUp");
	templateBuilder.Append("/images/wxIocn.png\" /><em>官方微信</em></a>\r\n      <a href=\"javascript:void(0);\"  onclick=\"divshow('官方微视')\"><img src=\"");
	templateBuilder.Append("/templates/JuiceUp");
	templateBuilder.Append("/images/wsIcon.png\" /><em>官方微视</em></a>\r\n      <a href=\"javascript:void(0);\"  onclick=\"divshow('密友分享')\"><img src=\"");
	templateBuilder.Append("/templates/JuiceUp");
	templateBuilder.Append("/images/myIcon.png\" /><em>密友分享</em></a>\r\n      <a href=\"javascript:void(0);\"  onclick=\"divshow('Instagram')\"><img src=\"");
	templateBuilder.Append("/templates/JuiceUp");
	templateBuilder.Append("/images/instagramIcon.png\" /><em>Instagram</em></a>\r\n      </div>\r\n    </div>\r\n    <div class=\"footer_con\">\r\n      <div class=\"center_wrapper\">\r\n        <div class=\"inner\">\r\n          <div class=\"inner_list\">\r\n            <h2><a href=\"#footer1\">清体排毒</a></h2>\r\n            <ul id=\"footer1\">\r\n            <li><a href=\"");
	templateBuilder.Append(linkurl("contentshow",113));

	templateBuilder.Append("\"> 什么是毒素</a></li>\r\n           <li><a href=\"");
	templateBuilder.Append(linkurl("contentshow",112));

	templateBuilder.Append("\">我需要排毒么</a></li>\r\n             \r\n            </ul>\r\n          </div>\r\n          <div class=\"inner_list\">\r\n            <h2><a href=\"#footer2\">JuiceUp</a></h2>\r\n            <ul id=\"footer2\">\r\n              <li><a href=\"");
	templateBuilder.Append(linkurl("contentshow",110));

	templateBuilder.Append("\">最专业的JuiceUp</a></li>\r\n\r\n              <li><a href=\"");
	templateBuilder.Append(linkurl("contentshow",111));

	templateBuilder.Append("\">果汁餐单</a></li>\r\n                <li><a href=\"");
	templateBuilder.Append(linkurl("contentshow",122));

	templateBuilder.Append("\">冷压技术</a></li>\r\n              <li><a href=\"");
	templateBuilder.Append(linkurl("contentshow",126));

	templateBuilder.Append("\">温馨提示</a></li>\r\n            </ul>\r\n          </div>\r\n          <div class=\"inner_list\">\r\n            <h2><a href=\"#footer3\">选择您的果汁</a></h2>\r\n            <ul id=\"footer3\">\r\n          <li><a href=\"");
	templateBuilder.Append(linkurl("contentshow",114));

	templateBuilder.Append("\">level1美味纤体系列</a></li>\r\n              <li><a href=\"");
	templateBuilder.Append(linkurl("contentshow",115));

	templateBuilder.Append("\">level2深层清体系列</a></li>\r\n             \r\n              \r\n             <!-- <li><a href=\"");
	templateBuilder.Append(linkurl("contentshow",117));

	templateBuilder.Append("\">个性化搭配</a></li>-->\r\n              <li><a href=\"");
	templateBuilder.Append(linkurl("contentshow",123));

	templateBuilder.Append("\">在线测试</a></li>\r\n            </ul>\r\n          </div>\r\n          <div class=\"inner_list\">\r\n            <h2><a href=\"#footer4\">价格及配送</a></h2>\r\n            <ul id=\"footer4\">\r\n              <li><a href=\"");
	templateBuilder.Append(linkurl("contentshow",119));

	templateBuilder.Append("\">价格&优惠</a></li>\r\n              <li><a href=\"");
	templateBuilder.Append(linkurl("contentshow",121));

	templateBuilder.Append("\">物流配送</a></li>\r\n              <li><a href=\"");
	templateBuilder.Append(linkurl("contentshow",120));

	templateBuilder.Append("\">订购须知</a></li>\r\n            </ul>\r\n          </div>\r\n          <ul class=\"inner_contact\">\r\n            <h2><a href=\"");
	templateBuilder.Append(linkurl("feedback"));

	templateBuilder.Append("\">联系我们</a></h2>\r\n            <p class=\"tile\"><img src=\"");
	templateBuilder.Append("/templates/JuiceUp");
	templateBuilder.Append("/images/emailIcon.png\" />&nbsp;提交留言</p>\r\n            <p class=\"form_con\">\r\n              <input class=\"t_tet\" value=\"我感觉咱们产品\" id=\"pad\" type=\"text\"/>\r\n              <input class=\"t_button\" value=\"提交\" type=\"button\" onclick=\"submitTest();\"  />\r\n            </p>\r\n            <img src=\"");
	templateBuilder.Append("/templates/JuiceUp");
	templateBuilder.Append("/images/juiceUpCar.png\" />\r\n          </ul>\r\n          <div class=\"footer_contact\">\r\n            <span class=\"tet\"><span class=\"inlineBlock\">CONTACT US</span>&nbsp;&nbsp;<span class=\"inlineBlock\"><a href=\"mailto:order@juiceupcleanse.com\">order@juiceupcleanse.com</a></span>&nbsp;&nbsp;<span class=\"inlineBlock\">  400-082-5955</span></span>\r\n            <span class=\"cp\">京ICP备14010510号-1&copy; 2014 JuiceUpCleanse. All rights reserved. </span>\r\n          </div>\r\n        </div>\r\n      </div>\r\n    </div>\r\n  </div>\r\n  <!---->\r\n  <div class=\"go_top\">返回顶端</div>\r\n  <!---->\r\n</div>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<script type=\"text/javascript\" src=\"");
	templateBuilder.Append("/templates/JuiceUp");
	templateBuilder.Append("/js/juiceup.js\"></");
	templateBuilder.Append("script>\r\n<!-- include jQuery + carouFredSel plugin -->\r\n<script type=\"text/javascript\" src=\"");
	templateBuilder.Append("/templates/JuiceUp");
	templateBuilder.Append("/js/jquery.glide.min.js\"></");
	templateBuilder.Append("script>\r\n\r\n<script type=\"text/javascript\">\r\n ");
	if (indexv==1)
	{

	}
	else
	{

	templateBuilder.Append("\r\n    $('.slidejuice').glide({});\r\n    ");
	}	//end for if

	templateBuilder.Append("\r\n</");
	templateBuilder.Append("script>\r\n\r\n<script type=\"text/javascript\">\r\nvar _bdhmProtocol = ((\"https:\" == document.location.protocol) ? \" https://\" : \" http://\");\r\ndocument.write(unescape(\"%3Cscript src='\" + _bdhmProtocol + \"hm.baidu.com/h.js%3F7bd688e72bcd07e55f4d4ae0e40278e2' type='text/javascript'%3E%3C/script%3E\"));\r\n</");
	templateBuilder.Append("script>\r\n\r\n\r\n\r\n</body>\r\n</html>");


	templateBuilder.Append("\r\n              <!--/Footer-->");
	Response.Write(templateBuilder.ToString());
}
</script>
